<template>
	<view>
		<view class="getcode" @click="getcode">
			<image src="../../static/getcode.png" mode=""></image>
			<view>轻触扫码</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {};
	},
	onShow() {
		this.subscriptionsMsg();
	},
	onHide() {},
	created() {},
	onLoad() {
		this.getcode();
	},
	methods: {
		getcode() {
			uni.scanCode({
				onlyFromCamera: true,
				success(res) {
					//扫码结果
					uni.navigateTo({
						url: `/pages/Instrumentdetails/Instrumentdetails?id=${res.result.split('=')[1]}`
					});
				}
			});
		}
	}
};
</script>

<style lang="less" scoped>
.getcode {
	text-align: center;
	padding-top: 220upx;

	image {
		width: 160px;
		height: 160px;
		margin-bottom: 30upx;
	}
}
</style>
